Type Systems for Optimizing Stack-based Code

نویسندگان

  • Ando Saabas
  • Tarmo Uustalu
چکیده

We give a uniform type-systematic account of a number of optimizations and the underlying analyses for a bytecode-like stack-based low-level language, including analysis soundness proofs and strongest analysis (principal type inference) algorithms. Specifically, we treat dead store instructions, load-pop pairs, duplicating load instructions, store-load pairs. The load-pop pairs and store-load pairs elimination optimizations are built on top of bidirectional analyses, facilitating correct elimination of instruction pairs spanning across basic block boundaries. As a result, no assumptions are needed about input code (it need not be the compiled form of a high-level source program, the stack need not be empty at basic block boundaries and not even need it be checked for safety before the analysis). The soundness proofs and strongest analysis algorithms are simple and uniform.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Generating Eecient Stack Code for Java

Optimizing Java byte code is complicated by the fact that it uses a stack-based execution model. Changing the intermediate representation from the stack-based to the register-based one brings the problem of Java byte code optimizations into well-studied domain of compiler optimizations for register-based codes. In this paper we describe the technique to convert a register-based code into the Ja...

متن کامل

Treegraph-based Instruction Scheduling for Stack-based Virtual Machines

Given the growing interest in the JVM and Microsoft’s CLI as programming language implementation targets, code generation techniques for efficient stack-code are required. Compiler infrastructures such as LLVM are attractive for their highly optimizing middleend. However, LLVM’s intermediate representation is register-based, and an LLVM code generator for a stack-based virtual machine needs to ...

متن کامل

Functional Java Bytecode

We describe the design and implementation of λJVM, a functional representation of Java bytecode that makes data flow explicit, verification simple, and that is well-suited for translation into lower-level representations such as those used in optimizing compilers. It is a good alternative to stack-based Java bytecode for virtual machines or ahead-oftime compilers which optimize methods and prod...

متن کامل

Typing Tools for Typeless Stack Languages

Many low-level runtime engines and virtual machines are stack based instructions take parameters from the stack and leave their results on the stack. Stack language is a common name for several languages used to program stack based (virtual) machines like CLR, JVM, Forth, Postscript, etc. We chose the Forth language as an example to represent the class of stack languages, partially because this...

متن کامل

Simple and Flexible Stack Types

Typed intermediate languages and typed assembly languages for optimizing compilers require types to describe stack-allocated data. Previous type systems for stack data were either undecidable or did not treat arguments passed by reference. This paper presents a simple, sound, decidable type system expressive enough to support the Micro-CLI source language, including by-reference arguments. This...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Electr. Notes Theor. Comput. Sci.

دوره 190  شماره 

صفحات  -

تاریخ انتشار 2007